<template>
    <div class="sidebar">
        <div class="icon"><a target="_blank" href="https://www.facebook.com/DLBSG/"></a></div>
        <div class="icon"><a target="_blank" href="https://mobile.twitter.com/Data_Link_Base"></a></div>
        <div class="icon"><a target="_blank" href="https://www.reddit.com/user/DataLinkBase"></a></div>
        <div class="icon"><a target="_blank" href="https://medium.com/@brcrng2867"></a></div>
        <div class="icon" v-show="isShowTopBtn" @click="goToTop"></div>
    </div>
</template>

<script>
export default {
    name: 'sidebar',
    props:{
        isShowTopBtn:{
            type: Boolean,
            default: false
        }
    },
    methods:{
        goToTop(){
            $('html,body').animate({scrollTop:0},1000);
        }
    }
}
</script>


<style lang="scss" scoped>
.sidebar{
    width: 35px;
    position: fixed;
    z-index: 100;
    top: 200px;
    right: 20px;
    .icon{
        width: 35px;
        height: 35px;
        margin-bottom: 20px;
        cursor: pointer;
        transition: all 0.3s;
        &:nth-child(1){
            background: url(./images/side-icon-1.png) no-repeat 0 0;
            background-size: 100% 100%;
            &:hover{
                background: url(./images/side-icon-hover-1.png) no-repeat 0 0;
                background-size: 100% 100%;
            }
        }
        &:nth-child(2){
            background: url(./images/side-icon-2.png) no-repeat 0 0;
            background-size: 100% 100%;
            &:hover{
                background: url(./images/side-icon-hover-2.png) no-repeat 0 0;
                background-size: 100% 100%;
            }
        }
        &:nth-child(3){
            background: url(./images/side-icon-3.png) no-repeat 0 0;
            background-size: 100% 100%;
            &:hover{
                background: url(./images/side-icon-hover-3.png) no-repeat 0 0;
                background-size: 100% 100%;
            }
        }
        &:nth-child(4){
            background: url(./images/side-icon-4.png) no-repeat 0 0;
            background-size: 100% 100%;
            &:hover{
                background: url(./images/side-icon-hover-4.png) no-repeat 0 0;
                background-size: 100% 100%;
            }
        }
        &:nth-child(5){
            background: url(./images/side-icon-top.png) no-repeat 0 0;
            background-size: 100% 100%;
            &:hover{
                background: url(./images/side-icon-hover-top.png) no-repeat 0 0;
                background-size: 100% 100%;
            }
        }
    }
}
</style>
